home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Examples
/
More Examples
/
L-system examples
< prev
next >
Wrap
Text File
|
1998-10-26
|
928b
|
58 lines
; koch curve
(def-grammar 'koch-curve
axiom (f + f + f + f)
f (f + f - f - f f + f + f - f)
- (-)
+ (+)
< (<)
> (>)
)
(gen-lsystem axiom 3 '(f + - < >) 'koch-curve)
; hilbert curve
(def-grammar 'hilbert-curve
axiom (x)
x (- y f + x f x + f y -)
y (+ x f - y f y - f x +)
- (-)
+ (+)
< (<)
> (>)
)
(gen-lsystem axiom 5 '(f + - < >) 'hilbert-curve)
; peano curve
(def-grammar 'peano-curve
axiom (x)
x (x f y f x + f + y f x f y - f - x f y f x)
y (y f x f y - f - x f y f x + f + y f x f y)
- (-)
+ (+)
< (<)
> (>)
)
(gen-lsystem axiom 3 '(f + - < >) 'peano-curve)
; dragon curve
(def-grammar 'dragon-curve
axiom (f x)
x (x + y f)
y (- f x - y)
- (-)
+ (+)
< (<)
> (>)
)
(gen-lsystem axiom 7 '(f + - < >) 'dragon-curve)
Does not produce anything useful because the 2D rules happens to map here
so that it all makes the curve going down.